package top.stime21.myneighbours

import android.app.Activity
import android.os.Bundle
import android.os.Handler
import top.stime21.framework.extension.toActivity
import top.stime21.myneighbours.api.LocalDataManager
import top.stime21.myneighbours.module.login.LoginActivity
import top.stime21.myneighbours.module.main.MainActivity

class SplashActivity : Activity() {
    val deleyTime:Long = 1500L;
    fun launch(){
        Handler().postDelayed({
            if(LocalDataManager.ins().getUser(this)!=null)
                toActivity<MainActivity>()
            else
                toActivity<LoginActivity>()
            finish();
        },deleyTime)
    }
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_splash)
        launch()
    }



}
